{/* Import Js,Css */}
	<css href="__PUBLIC__/plugs/ztree/css/metroStyle/metroStyle.css"/>
	<js href="__PUBLIC__/plugs/ztree/js/jquery.ztree.core-3.5.min.js"/>
	<css  href="__PUBLIC__/bootstrap/css/bootstrap.min.css" />
{/* Import Js,Css */}


<div class="panel" style="height:100%;padding: 0px;margin: 0px;">
  	<div class="panel-body" style="padding: 0px;margin: 0px;">
		<ul id="tree" class="ztree" style="overflow:auto;"></ul>
  	</div>
</div>

<script type="text/javascript" >
	var zTree;
	var _settings = {
		view: {
			fontCss: getFont,
			nameIsHTML: true,
			dblClickExpand: false,
			selectedMulti: false
		},
		data: {
			simpleData: {
				enable:true,
				idKey: "id",
				pIdKey: "pId",
				rootPId: ""
			}
		},
		callback: {
//			beforeClick: beforeClick,
			onClick: onClick
		}
	};
	
//	function beforeClick(treeId, treeNode, clickFlag) {
////		zTree.selectNode(zTree.getNodeByParam("id", 501)); // 可以使用cookie记录
////		className = (className === "dark" ? "":"dark");
////		showLog("[ "+getTime()+" beforeClick ]&nbsp;&nbsp;" + treeNode.name );
////		return (treeNode.click != false);
//	}
	function onClick(event, treeId, treeNode, clickFlag) {
		zTree.selectNode(zTree.getNodeByParam("id", treeNode.id)); // 可以使用cookie记录
//		console.log(treeNode.id);
//		alert(treeNode);
//		showLog("[ "+getTime()+" onClick ]&nbsp;&nbsp;clickFlag = " + clickFlag + " (" + (clickFlag===1 ? "普通选中": (clickFlag===0 ? "<b>取消选中</b>" : "<b>追加选中</b>")) + ")");
	}
	
	var zNodes =[
		{id:12, pId:0, name:"管理主界面",font:{'color':'red'}, url:'__APP__',target:'_self', open:false, icon:"__PUBLIC__/plugs/ztree/css/zTreeStyle/img/diy/1_close.png", iconClose:"__PUBLIC__/plugs/ztree/css/zTreeStyle/img/diy/1_close.png"},
		{id:1, pId:0, name:"滚动图片管理", url:"__APP__/adverse/adverseList", target:'_self', open:false, icon:"__PUBLIC__/plugs/ztree/css/zTreeStyle/img/diy/4.png"},
		{id:5, pId:0, name:"文章管理", open:true},
		{id:501, pId:5, name:"文章列表",font:{'color':'#707070'}, url:"__APP__/article/article_list", target:'_self'},
		{id:502, pId:5, name:"文章分类",font:{'color':'#707070'}, url:"__APP__/articlecat/articlecat_list", target:'_self'},
		{id:503, pId:5, name:"文章自动发布",font:{'color':'#707070'}, url:"__APP__/article/article_auto", target:'_self'},
		// 商品管理
		{id:1103, pId:0, name:"产品管理", open:true,},
		{id:1104, pId:1103, name:"商品列表", font:{'color':'#707070'},url:"__APP__/goods/goods_list", target:'_self'},
		{id:1105, pId:1103, name:"添加新商品", font:{'color':'#707070'}, url:"__APP__/goods/add_goods", target:'_self'},
		{id:1106, pId:1103, name:"商品分类", font:{'color':'#707070'}, url:"__APP__/goodscat/cat_list", target:'_self'},
		// 
		{id:10, pId:0, name:"商品管理", open:false,},
		{id:1001, pId:10, name:"商品列表", url:"__APP__/goods/goods_list", target:'_self'},
		{id:1002, pId:10, name:"添加新商品", url:"__APP__/goods/add_goods", target:'_self'},
		{id:1003, pId:10, name:"商品分类", url:"__APP__/goodscat/cat_list", target:'_self'},
		{id:1004, pId:10, name:"用户评论", url:"#", target:'_self'},
		{id:1005, pId:10, name:"商品品牌", url:"__APP__/brand/brand_list", target:'_self'},
		{id:1006, pId:10, name:"商品类型", url:"__APP__/goodstype/type_list", target:'_self'},
		{id:1007, pId:10, name:"商品回收站", url:"#", target:'_self'},
		{id:1008, pId:10, name:"图片批量处理", url:"#", target:'_self'},
		{id:1009, pId:10, name:"商品批量上传", url:"#", target:'_self'},
		{id:1010, pId:10, name:"商品批量导出", url:"#", target:'_self'},
		{id:1011, pId:10, name:"商品批量修改", url:"#", target:'_self'},
		{id:1013, pId:10, name:"标签管理", url:"__APP__/tag/tag_list", target:'_self'},
		{id:1014, pId:10, name:"虚拟商品列表", url:"#", target:'_self'},
		{id:1015, pId:10, name:"添加虚拟商品", url:"#", target:'_self'},
		{id:1016, pId:10, name:"更改加密串", url:"#", target:'_self'},
		{id:1017, pId:10, name:"商品自动上下架", url:"#", target:'_self'},
		{id:1018, pId:10, name:"虚拟商品列表", url:"#", target:'_self'},
		{id:1019, pId:10, name:"虚拟商品列表", url:"#", target:'_self'},
		// 用户评论2
		{id:2, pId:0, name:"用户评论", open:false},
		{id:201, pId:2, name:"评论列表", url:"__APP__/Comment/comment", target:'_self'},
		// 会员管理3
		{id:3, pId:0, name:"会员管理", open:false},
		{id:301, pId:3, name:"会员列表", url:"__APP__/User/user_list", target:'_self'},
		{id:302, pId:3, name:"会员等级", url:"__APP__/User/user_rank", target:'_self'},
		{id:303, pId:3, name:"会员留言", url:"__APP__/User/msg_list", target:'_self'},
		{id:304, pId:3, name:"充值和提现申请", url:"__APP__/User/account_list", target:'_self'},
		{id:305, pId:3, name:"会员资产管理", url:"__APP__/User/moneymanage", target:'_self'},
		// 权限管理4
		{id:4, pId:0, name:"权限管理", open:false},
		{id:401, pId:4, name:"管理员列表", url:"__APP__/Power/adminuser_list", target:'_self'},
		{id:402, pId:4, name:"管理员日志", url:"__APP__/Power/adminlog", target:'_self'},
		{id:403, pId:4, name:"用户组列表", url:"__APP__/Power/role_list", target:'_self'},
		{id:403, pId:4, name:"节点列表", url:"__APP__/Power/node_list", target:'_self'},
		
		// 订单管理
		{id:6, pId:0, name:"订单管理", open:false},
		{id:601, pId:6, name:"订单列表", url:"__APP__/Order/order_list", target:'_self'},
		{id:602, pId:6, name:"订单查询", url:"__APP__/Order/order_query", target:'_self'},
		{id:603, pId:6, name:"合并订单", url:"__APP__/Order/order_merge", target:'_self'},
		{id:604, pId:6, name:"订单打印", url:"__APP__/Order/order_template", target:'_self'}, // 订单打印模版
		{id:605, pId:6, name:"缺货登记", url:"__APP__/Booking/booking_list", target:'_self'},
		{id:606, pId:6, name:"添加订单", url:"__APP__/Order/add_order", target:'_self'},
		{id:607, pId:6, name:"发货单列表", url:"__APP__/Order/delivery_list", target:'_self'},
		{id:608, pId:6, name:"退货单列表", url:"__APP__/Order/back_list", target:'_self'},
		// 促销管理
		{id:7, pId:0, name:"促销管理", open:false},
		{id:701, pId:7, name:"夺宝奇兵", url:"__APP__/Snatch/snatch_list", target:'_self'},
		{id:702, pId:7, name:"红包类型", url:"__APP__/Bonus/bonus_type_list", target:'_self'},
		{id:703, pId:7, name:"商品包装", url:"__APP__/Pack/pack_list", target:'_self'},
		{id:704, pId:7, name:"祝福贺卡", url:"__APP__/Card/card_list", target:'_self'},
		{id:705, pId:7, name:"团购活动", url:"__APP__/Groupbuy/groupbuy_list", target:'_self'},
		{id:706, pId:7, name:"专题管理", url:"__APP__/Topics/topics_list", target:'_self'},
		{id:707, pId:7, name:"批发管理", url:"__APP__/Wholesale/wholesale_list", target:'_self'},
		{id:708, pId:7, name:"优惠活动", url:"__APP__/Favourable/favourable_list", target:'_self'},
		{id:709, pId:7, name:"超值礼包", url:"__APP__/Package/package_list", target:'_self'},
		{id:710, pId:7, name:"拍卖活动", url:"__APP__/Order/order_list", target:'_self'},
		{id:711, pId:7, name:"积分商城商品", url:"__APP__/Exchangegoods/Exchangegoods_list", target:'_self'},	
		// 代理商管理
		{id:8, pId:0, name:"代理商管理", open:false},
		{id:801, pId:8, name:"全部代理商", url:"__APP__/retail/retail_list", target:'_self'},
		{id:802, pId:8, name:"添加代理商", url:"__APP__/retail/add_retail", target:'_self'},
		// 系统设置9
		{id:9, pId:0, name:"系统设置", open:false},
		{id:401, pId:9, name:"支付方式", url:"__APP__/payment/pay_list", target:'_self'},
		
		// 商品提供商管理
		{id:11, pId:0, name:"提供商管理", open:false},
		{id:1101, pId:11, name:"全部提供商", url:"__APP__/supplier/supplier_list", target:'_self'},
		{id:1102, pId:11, name:"添加提供商", url:"__APP__/supplier/add_supplier", target:'_self'},		
	];
	
	
//		var zNodes =[
//			{ name:"粗体字", font:{'font-family':'微软雅黑'} },
//			{ name:"斜体字", font:{'font-style':'italic'}},
//			{ name:"有背景的字", font:{'background-color':'black', 'color':'white'}},
//			{ name:"红色字", font:{'color':'red'}},
//			{ name:"蓝色字", font:{'color':'blue'}},
//			{ name:"<span style='color:blue;margin-right:0px;'>view</span>.<span style='color:red;margin-right:0px;'>nameIsHTML</span>"},
//			{ name:"zTree 默认样式"}
//		];

		function getFont(treeId, node) {
			return node.font ? node.font : {};
		}
		
	
	// 初始化目录
	$(document).ready(function(){
		$.fn.zTree.init($("#tree"), _settings, zNodes);
		zTree = $.fn.zTree.getZTreeObj("tree");
	});
</script>



